import request from './request'
// 获取角色所有数据
export const getRolesData = () => request.get('roles');
// 删除权限
export const deleteRight = (roleId,rightId) => request.delete( `roles/${roleId}/rights/${rightId}`);
// 获取所有权限数据
export const getRightData = () => request.get("rights/tree")
// 分配权限
export const allotRight = (roleId,idstr) =>request.post(`roles/${roleId}/rights`, {rids: idstr,});
// 添加用户
export const addRoles = (data) => request.post("roles",data)
// 编辑修改用户
export const editRoles = (id,data) => request.put(`/roles/${id}`, data)
// 删除用户
export const deleteRoles = (rolesId) => request.delete(`roles/${rolesId}`)

// 获取所有权限数据
export const getRightsData = () => request.get("rights/list")

